<%@ page import="dao.UserInfoDao" %>
<%@ page import="dao.impl.UserInfoDaoImpl" %>
<%@ page import="java.util.Map" %>
<%@ page import="java.util.List" %><%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2022/3/23
  Time: 9:56
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="f" uri="http://java.sun.com/jsp/jstl/fmt" %>

<html>
<head>
    <title>成功页面</title>
</head>
<body>
    <h1>登录成功！</h1>
   <%-- <h1>欢迎<%=request.getAttribute("username")%></h1>--%>
    <h1>欢迎${username}</h1>

<%--    <%
        pageContext.setAttribute("pageKey",10000);
    %>--%>
 <%--   <h1>pageScope:${pageScope.get("pageKey")}</h1>
    <h1>requestScope:${requestScope.get("requestKey")}</h1>
    <h1>sessionScope:${sessionScope.get("seessionKey")}</h1>
    <h1>applicationScope:${applicationKey}</h1>--%>
<%--    此处是jsp的注释展示所有的用户--%>

        <a href="addUser.jsp">添加用户</a>
        <table border="1px">
            <tr>
                <td>编号</td>
                <td>用户名</td>
                <td>密码</td>
                <td>创建时间</td>
                <td>手机号</td>
                <td colspan="2">操作</td>
            </tr>
<%--            items 是集合  ，  var  是临时变量--%>
            <c:forEach items="${allUser}" var="userinfo">
                <tr>
                    <td>${userinfo.id}</td>
                    <td>${userinfo.username}</td>
                    <td>${userinfo.password}</td>
                    <td><f:formatDate value="${userinfo.createtime}" pattern="yyyy年MM月dd日 HH:mm:ss"></f:formatDate></td>
                    <td>${userinfo.phone}</td>
                    <td><a href="userinfo?method=del&id=${userinfo.id}">删除</a></td>
                    <td><a href="userinfo?method=toUpdate&id=${userinfo.id}">修改</a></td>

                </tr>
            </c:forEach>
        </table>


<!--   此处是html的注释-->
  <%--  <%
        for (int i = 0; i < 100; i++) {
            if(i%2==0){
                //out是jsp的内置对象，相当于 resp.getWriter().println
                out.println(i);
            }
        }
    %>
    <%!
        public int add(int a,int b){
            return a+b;
        }
    %>
    <%=add(23,45)%>--%>
</body>
</html>
